The present invention relates in general to a method and apparatus that perform data processing, and, more particularly, to a method and apparatus for processing multi-cycle instructions that may be interrupted during execution.
Interrupts are commonly used in data processing systems. For example, interrupts are especially important in many real-time control applications to allow a data processing system to quickly respond to real-time events. The time required for a data processing system to respond to an interrupt is the interrupt latency of the data processing system. A short interrupt latency time allows quick response to interrupts, but may reduce throughput of a data processing system. A long interrupt latency time slows response to interrupts, but may increase throughput of the data processing system. In most data processing systems, it is desirable to have the shortest possible interrupt latency time without reducing the normal operating performance of the data processing system.
Interrupt latency is typically affected by the timing of processor clock boundaries where interrupts are typically sampled. These boundaries occur at the completion of one instruction and the beginning of the next instruction. Multi-cycle instructions increase latency in a data processing system because instruction completion may take many cycles, thereby postponing a boundary where interrupts are sampled. Examples of such instructions are multiply, divide, move multiple memory items and fuzzy logic instructions. The time required to finish executing such instructions before responding to a pending interrupt request may cause the interrupt latency of a data processing system to be too long. The maximum amount of time required for a data processing system to respond to an interrupt, often the time for execution of the longest multi-cycle instruction, determines a data processing system""s xe2x80x9cmaximum interrupt latency timexe2x80x9d.
In most data processing systems, it is desirable to minimize the time a data processing system takes to respond to an interrupt. For example, a data processing system which is controlling an automobile engine may receive an interrupt request from the anti-lock braking system when the anti-lock braking system detects that the automobile has entered a skid. In many real-time control applications, a reduction of the maximum interrupt latency time is not only desirable, but also may determine which data processing system is chosen for a particular application. In the example above, if the engine control system cannot respond fast enough to the interrupt from the anti-lock braking system, another data processing system with a shorter interrupt latency time will often be chosen and used.
It is thus very desirable in the data processing field to reduce the maximum interrupt latency time without significantly reducing the normal operating performance of the data processing system. However, many prior systems that reduce interrupt latency also reduce processor throughput. The need to reduce interrupt latency must be balanced with the need to maximize data throughput of a data processing system. Accordingly, there is a need for an improved method and apparatus for processing instructions to reduce or minimize latency while minimally reducing or maintaining processor throughput.